import java.util.Arrays;
import java.util.Scanner;
public class hk6Q1try2
{
    public static void main(String[] args)
    {
        //用户测试环境
        //int[] arr = new int []{3,5,1,7,12,8};
        Scanner input = new Scanner(System.in);
        System.out.println("Please load in the array's length.");
        int len = input.nextInt(); 
        int[] arr = new int [len]; 
        for (int i = 0; i < arr.length; i++) 
        {
            System.out.println("Please load in the array's number");
            arr[i] = input.nextInt();
            //System.out.println(Arrays.toString(arr));
        }
        System.out.println("The array before the reverse order is " + Arrays.toString(arr));
        System.out.println();
        //System.out.println("倒序排列前的数组为" + Arrays.toString(arr));
        int temp = 0;
        int half = len / 2;
        if (half % 2 == 0)
        {
            for(int i = 0; i < half; i++) 
            {
                temp = arr[i];
                arr[i] = arr[arr.length - 1 - i];
                arr[arr.length - 1 - i] = temp;
            }
        }
        if (half % 2 != 0)
        {
            for (int i = 0; i < (half - 1) ; i++) 
            {
                temp = arr[i];
                arr[i] = arr[arr.length - 1 - i];
                arr[arr.length - 1 - i] = temp;
            }
        }
        System.out.println("The array after the reverse order is" + Arrays.toString(arr));
        input.close();
        //比起测试环境，用户环境主要是为了适应：不管用户输入什么数据，几个数据，都可以实现倒排
        //通过if的判断逻辑是可以做到的，这里给出了两款（主要区别在于数组长度的奇偶性）结果
    }
}